<?php
namespace Admin\Controller;
use Think\Controller;
use Common\Controller\BaseController;

/**
 * 保障业务申请开放管理
 * Class LzfStateController
 * @package Admin\Controller
 */
class ApplyStateController extends BaseController {

    /**
     * 保障业务申请开放管理 -> formview
     */
    public function detail(){
        $token = I("get.token");
        $type = I("get.type");
        $applyState = M("apply_state")->where(array("token"=>$token,"type"=>$type))->find();
        $this->assign("state", $applyState);

        $this->display();
    }

    /**
     * AJAX方法，通过ID来修改信息
     */
    public function ajax_UpdateInfoById(){
        $data = I("post.data");
        $dataId = I("post.id");
        $res = M("apply_state")->where(array("id"=>$dataId))->save($data);
        if($res){
            $this->success("0k, 200");
        }else{
            $this->error("更新异常，请稍候再试");
        }
    }

}